import rxAjax from '@/assets/js/ajax.js';
import AtsHolidayPolicyDetailApi from "@/api/oa/ats/atsHolidayPolicyDetail";

//轮班规则明细 api接口
export const AtsShiftRuleDetailApi = {};

AtsShiftRuleDetailApi.baseUrl= '/api-oa/oa/ats/atsShiftRuleDetail';
AtsShiftRuleDetailApi.exportUrl= AtsShiftRuleDetailApi.baseUrl + '/listExport';

//查询列表
AtsShiftRuleDetailApi.query=function (parameter) {
  var url= AtsShiftRuleDetailApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
AtsShiftRuleDetailApi.get =function(pkId) {
  var url= AtsShiftRuleDetailApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
AtsShiftRuleDetailApi.save =function(parameter) {
  var url= AtsShiftRuleDetailApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
AtsShiftRuleDetailApi.del =function(parameter) {
  var url= AtsShiftRuleDetailApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

AtsShiftRuleDetailApi.getAll = function () {
  var url = AtsShiftRuleDetailApi.baseUrl + '/getAll';
  return rxAjax.get(url);
}

AtsShiftRuleDetailApi.getByRuleId = function (ruleId) {
  var url = AtsShiftRuleDetailApi.baseUrl + '/getByRuleId?ruleId=' + ruleId;
  return rxAjax.get(url);
}

AtsShiftRuleDetailApi.getTime = function (shiftId) {
  var url = AtsShiftRuleDetailApi.baseUrl + '/gets?shiftId=' + shiftId;
  return rxAjax.get(url);
}

export  default AtsShiftRuleDetailApi;

